As networks have developed, the volume of attack traffic on the networks has also increased. The attack traffic (e.g., packets relating to distributed denial of service (DDoS) attacks) is aimed at disrupting the normal operations of networks. In a bypass mode, routers use dynamic routing such as static routing and border gateway protocol (BGP) routing to dynamically direct traffic to network cleaning equipment that cleans distributed denial of service (DDoS) attacks, and then the DDoS cleaning equipment uses various traffic injection techniques to reinject cleaned traffic into the network traffic. However, the DDoS cleaning equipment in in-path mode, out-of-path mode, or diversion mode can lead to interne protocol (IP) address errors due to policy-based routing configuration errors, thereby resulting in the existence of a loop in the network, which can then make the network unusable.